﻿using AutoMapper.Configuration.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
using XDQ.VAT.Classes;

namespace XDQ.VAT.Courses
{
    public class AppCourse : CreationAuditedAggregateRoot<Guid>, ISoftDelete, IMultiTenant, IEnablable
    {

        [MaxLength(200)]
        public virtual string Name { get; protected set; }

        [Ignore]
        public virtual Guid? TenantId { get; protected set; }

        [Required]
        [Ignore]
        public bool? IsDeleted { get; protected set; }

        [Required]
        public bool? IsEnabled { get; protected set; }

        [Ignore]
        bool ISoftDelete.IsDeleted { get => IsDeleted ?? false; set => IsDeleted = value; }

        //[Ignore]
        //public virtual ICollection<AppClassCourse> CourseClasses { get; set; }

        [Required]
        public int? Sort { get; set; }

        protected AppCourse() { }

        public AppCourse(Guid id) : base(id) {
            IsDeleted = false;
            IsEnabled = true;
        }

        public AppCourse(Guid id,string name,int order) : this(id)
        {
            Name = name;
            this.Sort = order;
        }

    }
}
